#ifndef _GAME_STATE_H_
#define _GAME_STATE_H_

#include <string>
#include "math/counter.h"
namespace gameflow
{

/// derive different game states from this guy
class GameState
{
public:
	enum				FADE_STATE
	{
		FADE_NONE,
		FADE_IN,
		FADE_OUT
	};

	
						GameState();
	virtual				~GameState();

	/// called when the game flow manager transitions into this game state
	virtual	bool		OnEnter();

	/// called when the game flow manager transitions out of this game state
	virtual	bool		OnExit();

	/// update the game
	virtual	bool		Tick(float dt);

	// a 
	virtual	bool		TransitionTick(float dt) { return true; };

	/// render the game
	virtual	bool		Render() = 0;

	/// get name
	const std::string&	GetName() const { return m_Name; };
	void				SetName(const std::string& N) { m_Name = N; };

	bool				IsCurrent() const { return m_IsCurrent; };

	virtual void		GainFocus() { };;
	virtual void		LoseFocus() { };
	virtual std::string	GetType() { return "state"; };
	virtual void		DPadNav(int	DirX, int DirY, int	Triggered) {};

	void				SetPrevMenu(const std::string& P) { m_PrevMenu = P; };
	void				GoPrevMenu();
protected:
	/// state name.. used for debugging mainly
	std::string			m_Name;
	float				m_OnEnter;
	bool				m_IsCurrent;
	unsigned int		m_FrameC;
	std::string			m_PrevMenu;
};
};

#endif // _GAME_STATE_H_